package com.spic.business.train.files.service.impl;

import java.util.List;
import com.spic.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.spic.business.train.files.mapper.TrainInfoFilesMapper;
import com.spic.business.train.files.domain.TrainInfoFiles;
import com.spic.business.train.files.service.ITrainInfoFilesService;

/**
 * 培训附件(除证书、心得体会以外的附件)Service业务层处理
 * 
 * @author spic
 * @date 2021-10-15
 */
@Service
public class TrainInfoFilesServiceImpl implements ITrainInfoFilesService 
{
    @Autowired
    private TrainInfoFilesMapper trainInfoFilesMapper;

    /**
     * 查询培训附件(除证书、心得体会以外的附件)
     * 
     * @param id 培训附件(除证书、心得体会以外的附件)主键
     * @return 培训附件(除证书、心得体会以外的附件)
     */
    @Override
    public TrainInfoFiles selectTrainInfoFilesById(String id)
    {
        return trainInfoFilesMapper.selectTrainInfoFilesById(id);
    }

    /**
     * 查询培训附件(除证书、心得体会以外的附件)列表
     * 
     * @param trainInfoFiles 培训附件(除证书、心得体会以外的附件)
     * @return 培训附件(除证书、心得体会以外的附件)
     */
    @Override
    public List<TrainInfoFiles> selectTrainInfoFilesList(TrainInfoFiles trainInfoFiles)
    {
        return trainInfoFilesMapper.selectTrainInfoFilesList(trainInfoFiles);
    }

    /**
     * 新增培训附件(除证书、心得体会以外的附件)
     * 
     * @param trainInfoFiles 培训附件(除证书、心得体会以外的附件)
     * @return 结果
     */
    @Override
    public int insertTrainInfoFiles(TrainInfoFiles trainInfoFiles)
    {
        trainInfoFiles.setCreateTime(DateUtils.getNowDate());
        return trainInfoFilesMapper.insertTrainInfoFiles(trainInfoFiles);
    }

    /**
     * 修改培训附件(除证书、心得体会以外的附件)
     * 
     * @param trainInfoFiles 培训附件(除证书、心得体会以外的附件)
     * @return 结果
     */
    @Override
    public int updateTrainInfoFiles(TrainInfoFiles trainInfoFiles)
    {
        return trainInfoFilesMapper.updateTrainInfoFiles(trainInfoFiles);
    }

    /**
     * 批量删除培训附件(除证书、心得体会以外的附件)
     * 
     * @param ids 需要删除的培训附件(除证书、心得体会以外的附件)主键
     * @return 结果
     */
    @Override
    public int deleteTrainInfoFilesByIds(String[] ids)
    {
        return trainInfoFilesMapper.deleteTrainInfoFilesByIds(ids);
    }

    /**
     * 删除培训附件(除证书、心得体会以外的附件)信息
     * 
     * @param id 培训附件(除证书、心得体会以外的附件)主键
     * @return 结果
     */
    @Override
    public int deleteTrainInfoFilesById(String id)
    {
        return trainInfoFilesMapper.deleteTrainInfoFilesById(id);
    }
    @Override
    public List<String> selectTrainInfoFilesUrlList(TrainInfoFiles trainInfoFiles){
        return trainInfoFilesMapper.selectTrainInfoFilesUrlList(trainInfoFiles);
    }
}
